//
// Created by lenovo on 25-5-7. 关系运算符重载
//
#include "iostream"
#include "string"
using namespace std;
class Person{
public:
    Person(string name,int age)
    {
        this->name= name;
        this->age = age;
    }
    bool operator==(Person &p)
    {
        if (this->name == p.name && this->age == p.age)
        {
            return true;
        } else{
            return false;
        }
    }
    bool operator!=(Person &p)
    {
        if (this->name == p.name && this->age == p.age)
        {
            return false;
        } else{
            return true;
        }
    }
    string  name;
    int age{};
};

void Test01()
{
    Person p1("tom",18);
    Person p3("tom",18);
    if (p1 != p3)
    {
        cout<<"p1 != p3"<<endl;
    } else{
        cout<<"p1 = p3"<<endl;
    }
}
int main()
{
    Test01();
    return 0;
}